package com.yiyuan.app.controller;

import com.guaike.core.entity.param.Page;
import com.guaike.core.entity.result.PageEntity;
import com.guaike.core.entity.result.Result;
import com.yiyuan.app.entity.result.RecordGameVO;
import com.yiyuan.app.entity.result.RecordPineconeVO;
import com.yiyuan.app.entity.result.RecordPrizeVO;
import com.yiyuan.app.service.RecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/record")
@Api(tags = "松树账本/赏金记录相关接口组")
@AllArgsConstructor
public class RecordController {

    private final RecordService recordService;

    @GetMapping("/myGamePage")
    @ApiOperation(value = "我的游戏记录列表")
    public Result<PageEntity<RecordGameVO>> myGamePage(@Valid Page param) {
        return recordService.myGamePage(param);
    }

    @GetMapping("/myPineconePage")
    @ApiOperation(value = "我的松果记录列表")
    public Result<PageEntity<RecordPineconeVO>> myPineconePage(@Valid Page param) {
        return recordService.myPineconePage(param);
    }

    @GetMapping("/myPrizePage")
    @ApiOperation(value = "我的赏金记录列表")
    public Result<PageEntity<RecordPrizeVO>> myPrizePage(@Valid Page param) {
        return recordService.myPrizePage(param);
    }
}
